package com.mdp;

public class Logger {
    public StringBuilder invokeClassMethodTrace() {
        StringBuilder sb = new StringBuilder(this.getClass().getName());
        StackTraceElement[] stacks = Thread.currentThread().getStackTrace();
        /*-
         * 0:getStackTace
         * 1:info
         * 2:invokeMethodName
         */
        if (stacks.length > 3) {
            sb.append("#").append(stacks[2].getMethodName());
        }
        System.out.println(sb.toString());
        return sb;
    }
}
